<template>
	<view class="box">
		<u-icon name="weixin-circle-fill" color="#56bc39" size="80"></u-icon>
		<view class="money">
			￥{{itemshop.serviceCharge}}
		</view>
		<view class="pay">
			支付成功
		</view>
		<view style="position: absolute; bottom: 120rpx; width: 90%;left: 50%; transform: translateX(-50%);">
			<u-button type="primary" text="查看订单" round="20" @click="confirmLease(itemshop)"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		serviceOrderIsPay
	} from "@/api/home/index.js"
	export default {
		data() {
			return {
				orderNo:'',
				itemshop: {}
			}
		},
		onLoad(option) {
			console.log(option);
			this.itemshop = JSON.parse(option.itemshop)
			console.log(this.itemshop);
			this.confirmLease(this.itemshop)
		},
		methods: {
			async confirmLease(itemshop) {
				const res = await serviceOrderIsPay(itemshop.orderNo);
				if (res.data.code != 200) return uni.showToast({
					title: res.data.msg,
					icon: 'error'
				})
				uni.redirectTo({
					url: './orderDetail?id='+ this.itemshop.id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "~@/styles/index.scss";
	@import "~@/styles/global.scss";

	.box {
		@include flexCenter;
		flex-direction: column;
		padding-top: 40rpx;

		.money {
			font-size: 60rpx;
			color: #eb5437;
			margin: 10rpx 0rpx;
		}

		.pay {
			font-size: 40rpx;
		}

		.button {
			margin-top: 60rpx;
		}
	}
</style>